import { Controller, Get } from '@nestjs/common';
import { CatsService } from './cats.service';
import { Cat } from './models/cat.interface';

@Controller('cats')
export class CatsController {
    constructor (private catservice :CatsService){}

    @Get('all')
    async findAll():Promise<Cat[]>{
        return this.catservice.findAll();
    }

    @Get('creat')
     createCat():string{
        this.catservice.create({
            name:'kk',
            age:5,
            breed:'olk'
        });
        return 'create success'
        
    }
}
